#ifndef APP_STATE_MODEL_H
#define APP_STATE_MODEL_H

#include <QObject>
#include <QList>
#include <QScopedPointer>

class PackMetadata;
class TexturePack;
class AppStateModel : public QObject {
  Q_OBJECT
 public:
  explicit AppStateModel(QObject* parent = NULL);

  const QList<TexturePack*>* packs() const {
    return packs_.data();
  }

  const PackMetadata* packMetadata() const {
    return pack_metadata_;
  }

  void setPackMetadata(PackMetadata* metadata) {
    pack_metadata_ = metadata;
  }

  void addTexturePack(TexturePack* pack) {
    packs_->append(pack);
  }

  void removeTexturePack(TexturePack* pack) {
    packs_->removeAll(pack);
  }

  TexturePack* defaultTexturePack() const {
    Q_ASSERT(!packs_->isEmpty());
    return packs_->first();
  }

 private:
  QScopedPointer< QList<TexturePack*> > packs_;
  PackMetadata* pack_metadata_;
};

#endif // APP_STATE_MODEL_H
